package com.shichenjia.fileupload.handler;

import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.reflection.MetaObject;
import org.springframework.stereotype.Component;
import java.time.LocalDateTime;
import java.time.ZoneId;

/**
 * @author : shichenjia
 * @date : 2025/5/17 20:09
 * @Version: 1.0
 */
@Slf4j
@Component
public class MyMetaObjectHandler implements MetaObjectHandler {
    @Override
    public void insertFill(MetaObject metaObject) {
        log.info("start insert fill...");
        this.setFieldValByName("insertTime", LocalDateTime.now(ZoneId.of("Asia/Shanghai")), metaObject);
    }
    @Override
    public void updateFill(MetaObject metaObject) {
        log.info("start update fill...");
    }
}
